#include "KeyTable.h"

KeyTable::KeyTable()
{
	for(int i = 0; i < NUM_KEYS; i++)
	{
		isDepressed[i] = false;
		wasDepressed[i] = false;
	}
}

KeyTable::~KeyTable()
{
}
bool KeyTable::HandleUserInput(unsigned char key, bool isDepressed)
{
	int index = (int)key - (int)' ';
	wasDepressed[index] = this->isDepressed[index];
	this->isDepressed[index] = isDepressed;
	
	if(this->isDepressed[index] && !wasDepressed[index])
	{
		return true;
	}
	return false;
}
